<%-- 
    Document   : purchaseForm
    Created on : 14/04/2009, 09:59:21 AM
    Author     : Joel Chuca
--%>

<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="purchasePayment.title"/></title>
    <meta name="heading" content="<fmt:message key='purchasePayment.heading'/>"/>
     <meta name="menu" content="RolePurchaser"/>
    <!--link rel="stylesheet" type="text/css" media="all" href="styles/calendar-aqua/theme.css" /-->

    <script type="text/javascript" src="<c:url value='/scripts/calendar/calendar.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/calendar/lang/calendar-es.js'/>"></script>
    <script type="text/javascript" src="<c:url value='/scripts/calendar/calendar-setup.js'/>"></script>
                                       
    <script type="text/javascript">
        window.onload = function() {
            Calendar.setup({
                inputField: "paidDate",
                ifFormat: "%d/%m/%Y",
                button: "paidDate"
            });           
        }        
    </script>
</head>
<div>El saldo restante a pagar es: <s:textfield name="rp" readonly="true" cssClass="text medium" /> </div>
<br>
<s:form id="purchasePaymentForm" action="savePurchasePayment" method="post" validate="true">
    <s:hidden key="purchasePayment.id" cssClass="text medium"/>
    <s:textfield key="paidDate" id="paidDate" cssClass="text medium"/>
    <s:textfield key="purchasePayment.code" required="true" cssClass="text medium" />
    <s:textfield key="purchasePayment.amount" required="true" cssClass="text medium" />
    <s:textfield key="purchasePayment.observation" required="true" cssClass="text medium" />

    <li class="buttonBar bottom">
        <s:submit cssClass="button" method="save" key="button.save" theme="simple"/>
        <c:if test="${not empty purchase.id}">
            <s:submit cssClass="button" method="delete" key="button.delete" onclick="return confirmDelete('purchasePayment')" theme="simple"/>
        </c:if>
        <s:submit cssClass="button" method="cancel" key="button.cancel" theme="simple"/>
    </li>
</s:form>


<script type="text/javascript">
    Form.focusFirstElement($("purchasePaymentForm"));
</script>